<template>
      
  <div class="">
    <div class="box">
      <div class="boxTop">
        <p>人气推荐</p>
        <i><van-icon name="arrow" /></i>
      </div>

      <ul>
        <li v-for="item in list" :key="item.id">
          <img :src="item.pic" alt="" />
          <p v-html="item.name" class="name"></p>
          <p v-html="item.characteristic" class="characteristic"></p>
          <p class="price">￥{{ item.originalPrice }}</p>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import { goodlist } from "../utils/api/home";
export default {
  data() {
    return {
      list: [],
    };
  },
  mounted() {
    goodlist().then((res) => {
      console.log(res);
      this.list = res.data.data;
    });
  },
  methods: {},
};
</script>

<style lang='scss' scoped>
.box {
  height: 12.24rem;
  position: relative;
  .boxTop {
    padding-left: 2.76rem;
    padding-right: 2.76rem;
    border-bottom: 1px solid #eee;
    height: 0.9rem;

    display: flex;
    line-height: 0.9rem;
    p {
      display: block;
      font-size: 0.38rem;
    }
    i {
      font-size: 0.38rem;
    }
  }
  ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    li {
      width: 3.36rem;

      img {
        width: 100%;
        height: 4.32rem;
      }
      .name {
        font-size: 0.27rem;
      }
      .characteristic {
        margin-top: 0.14rem;
        width: 80%;
        font-size: 0.24rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #b2b2b2;
      }
      .price {
        margin-top: 0.14rem;
        font-size: 0.24rem;
        color: red;
      }
    }
  }
}
</style>
